package com.pureut.equipment.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pureut.equipment.domain.DeviceRecord;
import com.pureut.equipment.domain.dto.DeviceOperationDto;
import com.pureut.equipment.domain.dto.DeviceRecordDto;
import com.pureut.equipment.domain.dto.GetDeviceInfoDto;
import com.pureut.equipment.domain.vo.DeviceRecordVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: CM
 * @date: 2023/2/13    9:57
 */
@Mapper
public interface DeviceRecordMapper extends BaseMapper<DeviceRecord> {

    /**
     * 新增设备信息
     */
    int insertDevice(DeviceRecord DeviceRecord);


    /*
       查询设备信息
     */
    List<DeviceRecordDto> getDeviceList(DeviceRecordVo deviceRecordVo);

    /**
     * 修改设备信息
     * @param DeviceRecord
     * @return
     */
    int updateDevice(DeviceRecord DeviceRecord);



    /**
     * 查看设备台账信息
     * @param id
     * @return
     */
    DeviceRecordDto viewRecord(@Param("id") long id);

    /**
     * 删除
     * @param DeviceIds
     * @return
     */
    int removeByIds(String[] DeviceIds);

    /**
     * 根据线别编码查看设备信息
     * @param lineCode
     * @return
     */
    DeviceRecordDto getLine(String lineCode);

    /**
     * 根据设备编码查出设备名称，设备类型
     * @param DeviceCode
     * @return
     */
    GetDeviceInfoDto getDeviceInfo(String DeviceCode);

    /**
     * 根据设备ids获取多个设备信息
     */
    List<DeviceRecordDto> getDeviceByIds(@Param("equipmentIds") List<String> equipmentIds);

    /**
     * 设备运行情况
     * @param lineCode
     * @return
     */
    List<DeviceOperationDto> getDeviceCondition(String lineCode);

    /**
     * 修改设备运行状态
     * @param status
     * @return
     */
    boolean updateEquipmentOperationStatus(int status);

    /**
     * 根据设备ids获取多个设备信息
     */
    List<DeviceRecord> selectDeviceByIds(@Param("deviceIdList") List<String> deviceIdList);

    long selectEquipmentById(String code);
}
